package com.itheima.common;

/**
 * @author Tang
 * @date 2023/2/21
 */
public class BaseContext {
    private static final ThreadLocal<Long> THREAD_LOCAL_ID = new ThreadLocal<>();

    //设置值
    public static void setCurrentId(Long id) {
        THREAD_LOCAL_ID.set(id);
    }

    //取值
    public static Long getCurrentId(){
        return THREAD_LOCAL_ID.get();
    }
}
